# Audio Transition-API Access
Make audio crossfade more smooth.
# Task Creation
Create an algorithm task based on the input parameters and return the task id
# Request Address
/v3/pic/acf/batch
# Request Parameter
Method
post
Header
Field | Required | Type | Value | Description |
---|---|---|---|---|
Content-Type | YES | string | application/json | |
Authorization | YES | string | Basic xxxxxxxxx | Basic base64 (appkey:appsecret) created by users combining appkey and secret |
Body
Field | Son Field | Required | Type | Value | Description |
---|---|---|---|---|---|
file_link | - | YES | string | Cloud storage address of audio file | |
crossfade_file_link | - | YES | string | Audio crossfade, only support mp3 and wav | |
crossfade_type | - | YES | number | There are five types of crossfade: 1: CT_Unknown, 2: CT_ConstantGain, 3: CT_ConstantPower, 4: CT_ExponentialFade, 5: CT_LogarithmicFade. The default is 1. | |
crossfade_duration | - | YES | number | Crossfade duration, double type, range [0.1, file_time) | |
file_info | - | YES | object | Audio file information | |
- | file_size | YES | number | File size, with unit of byte | |
- | file_md5 | YES | string | MD5 value of audio file | |
- | file_time | YES | number | integer (int) audio duration, with unit of seconds (s) | |
- | file_ext | YES | string | Audio file format, wav | |
file_ext | - | YES | string | Output audio format | |
priority | - | YES | integer | Priority, range [0,9] |
Sample Code
{
"file_link": "Downloadable audio file link",
"crossfade_file_link": "Downloadable audio file link",
"crossfade_type": 1,
"crossfade_duration": 1,
"file_ext": "wav",
"file_info": {
"file_size": 10778976,
"file_md5": "1bf1f1e6f112b2fb5836c1c3abcb5411",
"file_time": 168,
"file_ext": "wav"
},
"priority": 1
}
# Input File Restriction
Audio Format | Audio Size | Audio Length |
---|---|---|
MP3 WAV | No more than 50 MB |
# Return Data
Body
Field | Son Field | Required | Type | Value | Description |
---|---|---|---|---|---|
code | - | YES | number | Status Code | |
msg | - | YES | string | Request Information | |
data | - | YES | object | Response Data | |
- | task_id | YES | string | Task id |
Sample Code
{
"code": 0,
"msg": "",
"data": {
"task_id": "6a4eab77-be30-430a-bf0e-3048042a34ef"
}
}
# Result Acquisition
Request task processing result based on task id
# Request Address
/v3/pic/acf/result/{stask_id}
# Request Parameter
Method
get
Header
Field | Required | Type | Value | Description |
---|---|---|---|---|
Content-Type | YES | string | application/json | |
Authorization | YES | string | Basic xxxxxxxxx | Basic base64 (appkey:appsecret) created by users combining appkey and secret |
Path Parameter
Field | Son Field | Required | Type | Value | Description |
---|---|---|---|---|---|
task_id | - | YES | string | Task id |
# Return Data
Body
Field | Son Field | Required | Type | Value | Description |
---|---|---|---|---|---|
code | - | YES | number | Status Code | |
msg | - | YES | string | Request Information | |
data | - | YES | object | Response Data | |
- | status | YES | string | Task Status: 1- Waiting; 2 - In progress; 3 - Task complete; 4 - Task failure; 5 - Task closed; 6 - Task timed out | |
- | wait_time | YES | string | The waiting time before the next request, with unit of s | |
- | voice_result | YES | string | Audio download link after processing | |
- | reason | YES | string | Cause of failure |